package com.ygbhu.design.single;

/**
 * @program: design-pattern
 * @description:
 * @author: smzhu3
 * @create: 2021-06-16 10:54
 **/
public class EnumSingleton {
    private EnumSingleton() {
    }

    public static EnumSingleton getInstance() {
        return EnumHolder.INSTANCE.getInstance();
    }

    private enum EnumHolder {
        INSTANCE;
        private EnumSingleton instance = null;

        private EnumHolder() {
            instance = new EnumSingleton();
        }

        private EnumSingleton getInstance() {
            return instance;
        }
    }
}

